package com.lais.record.common.utils;

import com.lais.record.common.auth.UserInfo;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: luowen
 * @Description: 用户工具类
 * @Date: Create in 22:32 2019/11/28
 */
@Slf4j
public class UserInfoThreadLocal {

    private static ThreadLocal<UserInfo> userInfoThreadLocal = new ThreadLocal<>();

    public static UserInfo get(){
        return userInfoThreadLocal.get();
    }

    public static void set(UserInfo userInfo){
        userInfoThreadLocal.set(userInfo);
    }

    public static void remove(){
        userInfoThreadLocal.remove();
    }

}
